package riki.org.test.utils.time;

import java.util.Timer;

public class MyTimes{
	
	private Timer		myTimer;	
	private MyTimerTask	myTimerTask;	
	private	Object		objClass;
	private String		invokeMethodName;
	
	public	int		newDelay;
	
	
	public MyTimes(Object obj,String methodName,int delay)
	{
		newDelay			=	delay;
		objClass			=	obj;
		invokeMethodName	=	methodName;	
		restart();
	}
	
	public void restart() {
		myTimerTask	=	new MyTimerTask(objClass,invokeMethodName);		
		myTimer		= 	new Timer();
	}
	
	public void start() {
		myTimer.schedule(myTimerTask, 3000, newDelay);
	}
	
	public void stop() {
		myTimer.cancel();
	}
}
